<?php require_once './app/header.php';
if(empty($_SESSION['clean_data_users']) || empty($_SESSION['adress'])){
   $_SESSION['error'][]="Попълнете формите и прължете напред ! ";
    header('Location:adress.php');
}
 ?>
<section>
    
    <form class="form-data" action="app/noteValidation.php" method="POST">
     <fieldset>
  <legend><h4>Бележки</h4></legend>
        <textarea name="text[]" rows="10" cols="30"></textarea><br>

        <?php

        if (!empty($_SESSION['notes'])) {

            for ($i = 0; $i < count($_SESSION['notes']['text']); $i++) {
                echo '<h5>Допълнителна Бележка</h5><textarea name="text[]" rows="10" cols="30">' 
                . $_SESSION['notes']['text'][$i] . '</textarea><br>';
            }
        }
        ?>
        <input class="submit" type="submit" value="Запис" name="submit" />
        <input class="add" type="submit" value="Добави бележка" name="addnote" />
        </fieldset>
    </form>
</section>

<?php require_once './app/footer.php'; ?>
    